<!DOCTYPE html>
<!-- ng-app -->
<html lang="en" ng-app>
<head>
    <meta charset="UTF-8">
    <title>绑定一个页面元素</title>
    <script src="../../../js/plugins/angular/angular.min.js" type="text/javascript"></script>
</head>
<body>
    <!-- 对于下面的方法 -->
    <div ng-controller="usercontroller">
        <input type="text" ng-model="user.name">
        <div>{{user.name}}</div>
    </div>
    <script>
        function usercontroller($scope) {
            $scope.user = { name:"" };
        }
    </script>
</body>
</html>